Stop showing a raw org id, and shut the proxy down on exit - #12
Merged
Conversation
Both from the first outside dogfood (Ryan, #software): - "the organization is the ID not the name which a user probably wouldn't recognize". An API key genuinely cannot read its organization's NAME: /organizations/current needs a JWT org context and /organizations rejects key auth (both verified against prod). So asking someone to confirm 507f1f77bcf86cd799439011 was worse than not asking. The step now shows plan and credits, names the organization only when it resolves, and makes the escape hatch an actionable sentence instead of a hex string. - "if I quit does the gpt proxy shut off automatically?" It didn't. When the launcher starts the proxy it now stops it on exit, including Ctrl+C and terminal close (trap). A proxy that was ALREADY running belongs to another session and is left alone. Verified live: gpt session leaves no process behind, a second run starts a fresh one.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Both items from the first outside dogfood (Ryan in #software).
1. "the organization is the ID not the name"
Correct, and it turns out an API key cannot read its organization's name — verified against prod:
GET /organizations/current→MISSING_ORGANIZATION_CONTEXT(needs a JWT org context; theX-Organization-Idheader isn't enough for key auth)GET /organizations→User authentication required(rejects key auth outright)GET /organizations/mereturns membership with no org name in itSo the old step asked a non-technical user to confirm
507f1f77bcf86cd799439011. It now shows plan (from/ai/quota) and credits, names the organization only when it actually resolves, and replaces the hex string with the sentence that helps: create a key under the org you want, here's the link.The real fix — letting an API key resolve its own org name — is an api change; happy to file it separately if we want the name shown for key auth.
2. "if I quit does the gpt proxy shut off automatically?"
It didn't. Now: if the launcher started the proxy, it stops it on exit — including Ctrl+C and terminal close (
trap ... EXIT INT TERM HUP). A proxy that was already running belongs to another session and is left alone. Windows.cmddoes the same via the status/stop helper.Verified live: a gpt session leaves zero
cliproxyapiprocesses behind; a second run starts a fresh one and cleans up again.Suites green (routing 6/6, shellcheck, bash 3.2 parse).